def map_with_previous(function, iterable, first):
    for arg in iterable:
        yield function(first, arg)
        first = arg
